// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose:  Definition of the CImplUpload class..
//   $Id$


#ifndef __UPLOAD_H
#define __UPLOAD_H 1

#pragma once
#include "SingleNodeBinding.h"
#include "qname.h"
//child elements of CImplUpload
class CImplFileName : public CImplSingleNodeBinding
{
public:
	CImplFileName(){}
	virtual ~CImplFileName();
};

class CImplMediaType : public CImplSingleNodeBinding
{
public:
	CImplMediaType(){}
	virtual ~CImplMediaType();
};

#include "ImplFormControlInput.h"

//forward declaration of UI class
class CXFormsElementUpload;
#define UPLOAD_TYPE_COUNT 3

class CImplUpload : public CImplFormControlInput
{
public:
	CImplUpload(CXFormsElementUpload* pElement);
	virtual ~CImplUpload();
	
	// contains the mediatype attribute, a mediatype filter
	CComBSTR m_sMediatype;
	//	contains the XML location to store the actual filename
	CImplFileName * m_pFileName;
	//	contains the XML location to store the actual mediatype
	CImplMediaType * m_pMediaType;
	//<summary></summary>
	//<remarks> performs normal buildDependencies, but also
	//	checks to see if the node is of an appropriate type.
	//	</remarks>
	virtual void buildDependencies();
	bool m_bGetBinaryData;

	//<summary>HACK: when value changes, so will the child element values, get them at the same time</summary>
	virtual HRESULT putValue(BSTR const  sVal);

private:
	const static SQName sm_arrQNAvailableTypes[UPLOAD_TYPE_COUNT];
};

#endif